import Vue from 'vue'
import VueRouter from 'vue-router'

// 解决导航栏或者底部导航tabBar中的vue-router在3.0版本以上频繁点击菜单报错的问题。
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
  return originalPush.call(this, location).catch(err => err)
}
Vue.use(VueRouter)

const routes = [
	{
		path: '/',
		name: 'home',
		component: () => import(/* webpackChunkName: "about" */ '../views/index.vue')
	},
	{
		path: '/company/index',
		name: 'companyIndex',
		component: () => import(/* webpackChunkName: "about" */ '../views/HomeView.vue')
	},
	{
		path: '/about',
		name: 'about',
		// route level code-splitting
		// this generates a separate chunk (about.[hash].js) for this route
		// which is lazy-loaded when the route is visited.
		component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
	},
	{
		path: '/login',
		name: 'login',
		component: () => import(/* webpackChunkName: "about" */ '../views/login/index.vue')
	},
	{
		path: '/loginindex',
		name: 'loginIndex',
		component: () => import(/* webpackChunkName: "about" */ '../views/login/login.vue')
	},
	{
		path: '/code',
		name: 'code',
		component: () => import(/* webpackChunkName: "about" */ '../views/login/code.vue')
	},
	{
		path: '/company',
		name: 'company',
		component: () => import(/* webpackChunkName: "about" */ '../views/login/company.vue')
	},

	{
		path: '/post/index',
		name: 'postindex',
		component: () => import(/* webpackChunkName: "about" */ '../views/post/index.vue')
	},
	{
		path: '/post/add',
		name: 'postAdd',
		component: () => import(/* webpackChunkName: "about" */ '../views/post/add.vue')
	},
	{
		path: '/post/edit',
		name: 'postEdit',
		component: () => import(/* webpackChunkName: "about" */ '../views/post/edit.vue')
	},
	{
		path: '/post/addchildcompany',
		name: 'postAddChildCompany',
		component: () => import(/* webpackChunkName: "about" */ '../views/post/addchildcompany.vue')
	},
	{
		path: '/post/address',
		name: 'postAddress',
		component: () => import(/* webpackChunkName: "about" */ '../views/post/address.vue')
	},
	{
		path: '/post/info',
		name: 'postInfo',
		component: () => import(/* webpackChunkName: "about" */ '../views/post/postinfo.vue')
	},
	{
		path: '/user/index',
		name: 'userIndex',
		component: () => import(/* webpackChunkName: "about" */ '../views/user/index.vue')
	},

	{
		path: '/search/index',
		name: 'searchIndex',
		component: () => import(/* webpackChunkName: "about" */ '../views/search/index.vue')
	},
	{
		path: '/chat/index',
		name: 'chatIndex',
		component: () => import(/* webpackChunkName: "about" */ '../views/chat/index.vue')
	},
	{
		path: '/login/pwd',
		name: 'chatIndex',
		component: () => import(/* webpackChunkName: "about" */ '../views/login/loginPwd.vue')
	},
	{
		path: '/login/loginnew',
		name: 'login',
		component: () => import(/* webpackChunkName: "about" */ '../views/login/loginNew.vue')
	},
	{
		path: '/login/register',
		name: 'resiter',
		component: () => import(/* webpackChunkName: "about" */ '../views/login/register.vue')
	},
	{
		path: '/user',
		name: 'user',
		component: () => import(/* webpackChunkName: "about" */ '../views/post/userindex.vue')
	},
	{
		path: '/company/index',
		name: 'companyIndex',
		component: () => import(/* webpackChunkName: "about" */ '../views/company/index.vue')
	},
	{
		path: '/company/systeminfo',
		name: 'companySysteminfo',
		component: () => import(/* webpackChunkName: "about" */ '../views/login/systeminfo.vue')
	},
	{
		path: '/company/accountInfo',
		name: 'companyAccountInfo',
		component: () => import(/* webpackChunkName: "about" */ '../views/login/accountInfo.vue')
	},
	{
		path: '/company/childAccount',
		name: 'companyChildAccount',
		component: () => import(/* webpackChunkName: "about" */ '../views/login/childAccount.vue')
	},
	{
		path: '/company/interviewCalendar',
		name: 'companyInterviewCalendar',
		component: () => import(/* webpackChunkName: "about" */ '../views/login/interviewCalendar.vue')
	},
	{
		path: '/company/query',
		name: 'companyQuery',
		component: () => import(/* webpackChunkName: "about" */ '../views/login/query.vue')
	},
	{
		path: '/company/uploadResume',
		name: 'companyUploadResume',
		component: () => import(/* webpackChunkName: "about" */ '../views/login/uploadResume.vue')
	},
	{
		path: '/biographicalnotes/add',
		name: 'biographicalNotesAdd',
		component: () => import(/* webpackChunkName: "about" */ '../views/biographicalNotes/add.vue')
	},
	{
		path: '/user/userReme',
		name: 'userReme',
		component: () => import(/* webpackChunkName: "about" */ '../views/user/userReme.vue')
	},
	{
		path: '/user/post',
		name: 'userPost',
		component: () => import(/* webpackChunkName: "about" */ '../views/user/post.vue')
	},
	{
		path: '/user/havepost',
		name: 'userHavePost',
		component: () => import(/* webpackChunkName: "about" */ '../views/user/havepost.vue')
	},
	{
		path: '/user/activepost',
		name: 'userActivepost',
		component: () => import(/* webpackChunkName: "about" */ '../views/user/activepost.vue')
	},
]

const router = new VueRouter({
	routes
})

export default router
